-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(llmobs): add sampling for ragas skeleton code #10719
Conversation
|
Datadog ReportBranch report: ✅ 0 Failed, 170 Passed, 780 Skipped, 1m 18.06s Total duration (13m 12.97s time saved) |
BenchmarksBenchmark execution time: 2024-10-09 14:17:16 Comparing candidate commit 2ae2917 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 371 metrics, 53 unstable metrics. |
…py into evan.li/ragas-skeleton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic here lgtm! just left one clarifying question but idt it's blocking.
…gas-skeleton-with-sampling
…aDog/dd-trace-py into evan.li/ragas-skeleton-with-sampling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just did a quick first pass, i'll take a closer look later today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise, my comments are optional to address if you'd like
V0 sampling implementation for evaluator runner. The evaluator runner is a period service that stores a list of (evaluations to generate / "evaluators") on finished LLM obs span events. The runner will have a list of sampling rules that it applies to spans before triggering any evaluator on that span.
Evaluator sampler rules are configured by setting
_DD_LLMOBS_EVALUATOR_SAMPLING_RULES
to a json list of rulesEach rule consists of the following:
sample_rate
(required)evaluator_label
(optional, the evaluator name)span_name
(optional, the span name). Not that for APM trace sampling rules,span_name
is justname
. But since we're dealing with both evaluator names/labels and span names, and perhaps more names such as ml app in the future, I think it's better to be more verbose for clarity.Supporting sampling rules based on evaluator label and span name is key since most evaluators do not apply to all types of spans. For example, a faithfulness evaluation only applies to an LLM generation that uses a ground truth reference context.
Example Usage:
Code Changes:
span._trace_id_64bits
field is used for samplingEvaluatorSampler
helper class that theEvaluationRunner
uses for sampling. The EvaluationRunner stores one instance ofEvaluatorSampler
, which internally stores a list ofEvaluatorSamplingRule
(s). TheEvaluatorSamplingRule
class inherits fromSamplingRule
so we can re-use some helpful utilities e.g. thesample
method.Follow ups
Checklist
Reviewer Checklist